<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="keywords" content="{iMicms::C('keyword')}" />
<meta name="description" content="{iMicms::C('content')}" />   
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/bootstrap_min.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/bootstrap_responsive_min.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/sstyle.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/todc_bootstrap_button.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/themes.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/daterangepicker.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/inside.css?2013-9-13-2" media="all" />
<link rel="stylesheet" type="text/css" href="{iMicms::RES}/css/vote/chosen.css?2013-9-13-2" media="all" />
<script type="text/javascript" src="{iMicms::RES}/js/jQuery.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/jquery_ui_widget_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/bootstrap_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/jquery_form_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/jquery_validate_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/jquery_validate_methods.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/jquery_form_wizard_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/daterangepicker.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/moment_min.js?2013-9-13-2"></script>
<script type="text/javascript" src="{iMicms::RES}/js/inside.js?2013-9-13-2"></script>
<title>{iMicms::C('site_name')}-{iMicms::C('site_title')}</title>
<link rel="shortcut icon" href="/tpl/static/favicon.ico" />
    <!--[if lte IE 9]><script src="{iMicms::RES}/js/watermark.js"></script><![endif]-->
	<!--[if IE 7]><link href="{iMicms::RES}/css/vote/font_awesome_ie7.css" rel="stylesheet" /><![endif]-->
</head>
<body>
	<body>
    <div id="main">
        <div class="container-fluid">

            <div class="row-fluid">
                <div class="span12">

                    <div class="box">
                        <div class="box-title">
                            <div class="span10">
                                <h3><i class="icon-edit"></i> <if condition="$type eq 2">图片<else/>文字</if>投票设置</h3>
                            </div>
                            <div class="span2"><a class="btn" href="Javascript:window.history.go(-1)">返回</a></div>
                        </div>

                        <div class="box-content">
                            <form action="" method="post" class="form-horizontal form-validate" enctype="multipart/form-data">
                              <input type="hidden" name="id" value="{iMicms:$id}">
                              <input type="hidden" name="type" value="{iMicms:$type}">
                                <div class="control-group">
                                    <label for="keyword" class="control-label">关键词：</label>
                                    <div class="controls">
                                        <input type="text" name="keyword" id="keyword"  value="{iMicms:$info.keyword}" class="input-large" data-rule-required="true" data-rule-maxlength="30" /><span class="help-inline">多个关键字请用空格隔开，用户输入此关键词将会触发此活动。</span>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label" for="title">投票标题</label>
                                    <div class="controls">
                                        <input type="text" name="title" id="title"  value="{iMicms:$info.title}"  class="input-large" data-rule-required="true" data-rule-maxlength="60" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label" for="picurl">投票图片</label>
                                    <div class="controls">

                                        <div class="input-append">
                                            <input class="input-xlarge" type="text" name="vpicurl"   value="{iMicms:$info.vpicurl}"  id="picurl" readonly />
                                            <span class="help-inline"><a class="btn insertimage">选择图片</a></span>

                                        </div>
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label for="third" class="control-label">图片显示：</label>
                                    <div class="controls">
                                        <label class="radio inline">
                                            <input type="radio" name="pic_show" value="1"  <if condition="$info.pic_show eq 1">checked="checked"</if> />
                                            显示在投票页面  
                                        </label>
                                        <label class="radio inline ">
                                            <input type="radio" name="pic_show" value="2"  <if condition="$info.pic_show eq 2">checked="checked"</if>  />
                                            不显示在投票页面
                                        </label>

                                    </div>
                                </div>

                                <div class="control-group">
                                    <label for="sttxt" class="control-label">投票说明：</label>
                                    <div class="controls">
                                        <textarea name="instructions" rows="5" cols="20">{iMicms:$info.instructions}</textarea>
                                        </div>
                                </div>
                                <div class="control-group">
                                    <label for="third" class="control-label">投票选项：</label>
                                    <div class="controls">
                                        <a id="vtype" class="btn" href="javascript:void(0)">添加选项</a>
                                        <table id="listTable" class="table table-bordered table-hover  dataTable" style="width: 750px">
                                            <!-- 文字投票为500大小-->
	                                                                                    <tr>
                                                <th>选项标题</th>
                                                <th>排序</th>
                                                <if condition="$type eq 2">
 					        <th>图片外链地址</th>
                                                <th>图片跳转地址以http://开头</th>
						</if>
                                                <th></th>
                                            </tr>
					   <volist name="vlist" id="vinfo" key="b">  
                                          <tr> 
					  <td><input type="text" name="vtitle[]" class="input-medium" value="{iMicms:$vinfo.vtitle}"></td>
					  <td><input type="text" name="sort[]" class="input-mini"  value="{iMicms:$vinfo.sort}"></td>
					  <if condition="$type eq 2"> 
					  <td><div class="input-append"> <input type="text" name="picurl[]" class="input-medium" value="{iMicms:$vinfo.picurl}" readonly> <span class="help-inline"><a class="btn insertimage">选择图片</a></span></div></td>
					  <td><input type="text" name="piclink[]" class="input-medium"  value="{iMicms:$vinfo.piclink}"  ></td>
					  </if>
					  <td><a class="del" href="javascript:void(0)" class="btn btn-primary btn_submit  J_ajax_submit_btn">删除</a></td>
					  </tr>
                                            </volist>  
                                        </table>
					<script src="{iMicms::STATICS}/kindeditors/kindeditor-min.js"></script>
                                        <script src="{iMicms::STATICS}/kindeditors/lang/cn.js"></script>

                                        <link href="{iMicms::STATICS}/kindeditors/themes/default/default.css" rel="stylesheet" />
                                        
                                        <script type="text/javascript">
					    
                                            var text_tmp = '<tr><td><input type="text" name="vtitle[]" class="input-large"></td> <td><input type="text" name="sort[]"  class="input-mini"></td> <td><a class="del" href="javascript:void(0)">删除</a></td> </tr>';
                                            var img_tmp = '<tr> <td><input type="text" name="vtitle[]" class="input-medium" /></td><td><input type="text" name="sort[]" class="input-mini" /></td>' +
                                                '<td><div class="input-append"> <input type="text" name="picurl[]" class="input-medium" readonly /> <span class="help-inline"><a class="btn insertimage">选择图片</a></span></div></td>' +
                                                '<td><input type="text" name="piclink[]" class="input-medium" /></td><td><a class="del" href="javascript:void(0)">删除</a></td></tr>';
                                            $("#vtype").click(function () {
					           
                                                   var ty = {iMicms:$ty}; 
                                                   $("#listTable").append(ty ? text_tmp : img_tmp);
                                            });
                                            $("#listTable .del").live("click", (function () {
                                                $(this).parents("tr").remove();
                                            }))

                                            KindEditor.ready(function (K) {
                                                var editor = K.editor({
                                                    themeType: "simple",
                                                    allowFileManager: true

                                                });
                                                $('a.insertimage').live("click", function (e) {
                                                    editor.loadPlugin('smimage', function () {
                                                        editor.plugin.imageDialog({
                                                            imageUrl: $(e.target).parent().prev().val(),
                                                            clickFn: function (url, title, width, height, border, align) {
                                                                $(e.target).parent().prev().val(url);
                                                                editor.hideDialog();
                                                            }
                                                        });
                                                    });
                                                });

                                            });
                                        </script>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label for="third" class="control-label">单选/多选：</label>
                                    <div class="controls">
                                        <label class="radio inline">
                                            <input type="radio" name="is_radio" value="1"  <if condition="$info.is_radio eq 1">checked="checked"</if>  onclick="$('#collapse_div').collapse('hide')" />
                                            单选   
                                        </label>
                                        <label class="radio inline">
                                            <input type="radio" name="is_radio" value="2" <if condition="$info.is_radio eq 2">checked="checked"</if> onclick="$('#collapse_div').collapse('show')" />
                                            多选
                                        </label>

                                    </div>
                                </div>
			 
                                <div id="collapse_div" class="collapse">
                                    <div class="control-group">
                                        <label for="jp4" class="control-label">多选数量：</label>
                                        <div class="controls">
                                            <input name="select_num" class="input-mini" size="4" type="text" value="{iMicms:$info.select_num}" data-rule-number="true" />
                                        </div>
                                    </div>

                                </div>
				 
                                <div class="control-group">
                                    <label class="control-label" for="">时间设置</label>
                                    <div class="controls">
                                        <div class="input-prepend">
                                            <span class="add-on"><i class="icon-calendar"></i></span>
                                            <input type="text" name="time" id="time" value="{iMicms:$info.qstime}" class="daterangepick input-xlarge" readonly data-rule-required="true" />
                                        </div>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label for="third" class="control-label">投票结果：</label>
                                    <div class="controls">
                                        <label class="radio inline">
                                            <input type="radio" value="1" name="result"  <if condition="$info.result eq 1">checked="checked"</if> />
                                            投票前可见   
                                        </label>
                                        <label class="radio inline">
                                            <input type="radio" value="2" name="result" <if condition="$info.result eq 2">checked="checked"</if> />
                                            投票后可见
                                        </label>
                                        <label class="radio inline">
                                            <input type="radio" value="3" name="result" <if condition="$info.result eq 3">checked="checked"</if> />
                                            投票结束可见
                                        </label>

                                    </div>
                                </div>
                                <div class="form-actions">
                                    <button id="bsubmit" type="submit" data-loading-text="提交中..." class="btn btn-primary">保存</button>
                                    <button class="btn">取消</button>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>

</body></body>
</html>
